import { getToken } from "@/utils/token";
import { Navigate } from "react-router-dom";

function AuthRouter({children}) {
    if(getToken()){
        return <>{children}</>;
    }else{
        //重定向组件
      return  <Navigate to={"/login"} replace />
    }
}

export default AuthRouter;